<script type="text/javascript">
	function areyousure(obj, e){
		if(!confirm('Bạn muốn xóa?')){
			e.preventDefault();
			return false;
		}
		return true;
	}
</script>
<div class="btn-group pull-right">
	<a class="btn" href="<?php echo base_url('admin/media/upload'); ?>"><i class="icon-plus-sign"></i> Upload files</a>
</div>

<div class="page-header">
	<h1>Media <small>All files</small></h1>
</div>
<table class="table table-striped table-bordered table-condensed">
	<thead>
		<tr>
			<th>ID</th>
			<th>Thumb</th>
			<th>File Name</th>
			<th>Desc</th>
			<th>Type</th>				
			<th>Size</th>
			<th>Path</th>
			<th>Created</th>
			<th></th>
		</tr>
	</thead>
	<tbody>
	<?php if($media):
		foreach($media as $obj): 
	?>
		<tr class="list-users">
			<td><?=$stt++?></td>
			<td><img src="<?='/assets/timthumb.php?w=60&src='.$obj->path?>" /></td>
			<td><?=$obj->file_name?></td>
			<td><?=$obj->desc?></td>
			<td><?=$obj->type?></td>
			<td><?=$obj->size?></td>
			<td><input style="width:170px" type="text" value="<?=base_url($obj->path)?>"/></td>
			<td><?=$obj->created?></td>
			<td>
				<div class="btn-group">
					<a class="btn btn-mini dropdown-toggle" data-toggle="dropdown" href="#">Actions <span class="caret"></span></a>
					<ul class="dropdown-menu pull-right">
						<li><a href="<?php echo base_url('admin/media/form/'.$obj->id); ?>"><i class="icon-pencil"></i> Edit</a></li>
						<li><a onclick="areyousure(this,event);" href="<?php echo base_url('admin/media/delete/'.$obj->id); ?>"><i class="icon-trash"></i> Delete</a></li>
					</ul>
				</div>
			</td>
		</tr>
	<?php endforeach;
		endif;
	?>
	</tbody>
</table>
<?php echo '<div class="pagination">'.$this->pagination->create_links().'</div>'; ?>
<?/*
<div class="pagination">
	<ul>
		<li><a href="#">Prev</a></li>
		<li class="active">
			<a href="#">1</a>
		</li>
		<li><a href="#">2</a></li>
		<li><a href="#">3</a></li>
		<li><a href="#">4</a></li>
		<li><a href="#">Next</a></li>
	</ul>
</div>*/?>
